<!doctype html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
        <!-- Apple devices fullscreen -->
        <meta name="apple-mobile-web-app-capable" content="yes">
        <!-- Apple devices fullscreen -->
        <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
        <link href="__PUBLIC__/plugins/layui/css/layui.css?v={$version}" rel="stylesheet" type="text/css">
        <link href="__WEAPP_TEMPLATE__/skin/css/main.css?v={$weappInfo.version|default='v1.0.0'}" rel="stylesheet" type="text/css">
        <link href="__WEAPP_TEMPLATE__/skin/css/page.css?v={$weappInfo.version|default='v1.0.0'}" rel="stylesheet" type="text/css">
        <link href="__PUBLIC__/static/admin/font/css/font-awesome.min.css?v={$version}" rel="stylesheet" />
        <link href="__PUBLIC__/static/admin/font/css/iconfont.css?v={$version}" rel="stylesheet" />
        <!--[if IE 7]>
          <link rel="stylesheet" href="__SKIN__/font/css/font-awesome-ie7.min.css?v={$version}">
        <![endif]-->
        <link href="__PUBLIC__/static/admin/js/jquery-ui/jquery-ui.min.css?v={$version}" rel="stylesheet" type="text/css"/>
        <link href="__PUBLIC__/static/admin/css/perfect-scrollbar.min.css?v={$version}" rel="stylesheet" type="text/css"/>
        <style type="text/css">html, body { overflow: visible;}</style>
        <script type="text/javascript">
            // 子目录
            var __root_dir__ = "__ROOT_DIR__";
        </script>
        <script type="text/javascript" src="__PUBLIC__/static/admin/js/jquery.js?v={$version}"></script>
        <script type="text/javascript" src="__PUBLIC__/static/admin/js/jquery-ui/jquery-ui.min.js?v={$version}"></script>
        <script type="text/javascript" src="__PUBLIC__/plugins/layer-v3.1.0/layer.js?v={$version}"></script>
        <script type="text/javascript" src="__PUBLIC__/static/admin/js/admin.js?v={$weappInfo.version|default='v1.0.0'}"></script>
        <script type="text/javascript" src=__PUBLIC__/static/admin//js/perfect-scrollbar.min.js?v={$version}"></script>
        <script src="__PUBLIC__/static/admin/js/global.js?v={$weappInfo.version|default='v1.0.0'}"></script>
        <script type="text/javascript" src="__PUBLIC__/static/admin/js/clipboard.min.js"></script>
    </head>

    <body class="bodystyle" style="cursor: default; -moz-user-select: inherit;min-width:auto;">
        <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
        <div id="append_parent"></div>
        <div id="ajaxwaitid"></div>
        <div class="page">
            {include file="mbackend/bar.htm" /}
            <form class="form-horizontal" id="post_form">
                <div class="ncap-form-default" style="position: relative;min-height: 700px;">
                    <dl class="row">
                        <dt class="tit">
                            <label for="status">手机访问跳转</label>
                        </dt>
                        <dd class="opt">
                            <label class="curpoin">
                                <input id="status1" name="status" value="1" type="radio" {if condition="!empty($data.status)"}checked="checked"{/if}>开启
                            </label>
                            &nbsp;
                            <label class="curpoin">
                                <input id="status0" name="status" value="0" type="radio" {if condition="empty($data.status)"} checked="checked"{/if}>关闭
                            </label>
                            <span class="err"></span>
                            <p class="notic">开启后，用手机访问默认后台路径时会打开手机后台</p>
                        </dd>
                    </dl>

                    <dl class="row">
                        <dt class="tit">
                            <label for="local">手机后台URL</label>
                        </dt>
                        <dd class="opt">
                            <div class="w400 ellipsis blocki">{$url}</div>
                            <a href="javascript:void(0);" onclick="showtext('wapurl');" class="ui-btn3 blue wapurl" data-clipboard-text="{$url}">复制</a>
                        </dd>
                    </dl>

                    <dl class="row">
                        <dt class="tit">
                            <label for="local">后台二维码</label>
                        </dt>
                        <dd class="opt">
                            <img src="{$qrCode}" width="120" height="120">
                            <p class="notic2">手机端扫码浏览后，请收藏保存，以便后续浏览登录</p>
                        </dd>
                    </dl>

                    <dl class="row">
                        <dt class="tit">
                            <label for="loginMode">后台登录模式</label>
                        </dt>
                        <dd class="opt">
                            <label class="curpoin">
                                <input type="checkbox" name="loginMode[]" value="default" {if condition="!empty($data['loginMode']) && in_array('default', $data['loginMode'])"} checked="checked" {/if}>账号/密码
                            </label>
                            &nbsp;
                            <label class="curpoin">
                                <input type="checkbox" name="loginMode[]" value="userGzhLogin" {if condition="!empty($data['loginMode']) && in_array('userGzhLogin', $data['loginMode'])"} checked="checked" {/if}>微信授权
                            </label>
                            <span class="err"></span>
                            <p class="notic"></p>
                            <p id="notic2_tips_1" class="notic2 red {if condition="!empty($data['loginMode']) && !in_array('userGzhLogin', $data['loginMode'])"} none {/if}">确保所有管理员都已在个人信息里绑定微信，否则没法微信授权登录</p>
                        </dd>
                    </dl>

                    <div class="bot">
                        <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">保存</a>
                    </div>
                    
                    <div class="mobile-fr-flex">
                        <div class="mobile-iframe">
                            <div class="mobile-iframe-wrap">
                                <iframe src="{$url}" frameborder="0" width="100%"></iframe>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </body>
    <script type="text/javascript">
        function checkForm() {
            layer_loading('正在处理');
            $.ajax({
                url : "{:weapp_url('Mbackend/Mbackend/config')}",
                data: $('#post_form').serialize(),
                type: 'post',
                dataType: 'json',
                success: function(res){
                    layer.closeAll();
                    if (1 == res.code) {
                        layer.msg(res.msg, {time: 2000}, function() {
                            window.location.reload();
                        });
                    } else {
                        layer.alert(res.msg, {icon: 0});
                    }
                }
            });
        }
        function showtext(classname){
            var clipboard1 = new Clipboard("."+classname);clipboard1.on("success", function(e) {layer.msg("复制成功");});clipboard1.on("error", function(e) {layer.msg("复制失败！请手动复制", {icon:5});}); 
        }
    </script>
{include file="public/footer.htm" /}
